package com.esxy.cloud.controller;

import com.esxy.cloud.pojo.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    //8002调用8001
    @GetMapping("/getOrderByPaymentAll")
    public List<Payment> getOrderByPayment(){
        List forObject = restTemplate.getForObject("http://localhost:8001/payment/getPaymnetAll",List.class);
        return forObject;
    }
}
